package com.dyw.springbootpersonal.utils;

import com.dyw.springbootpersonal.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Devil
 * @create 2022-01-29-23:16
 */
@Slf4j
@RestControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler
    public Result doException(Exception ex) {
        log.error("服务器故障,请稍后再试...");
        return new Result(false, "服务器故障,请稍后再试...");
    }
}
